import ajax from './ajax.js'

// http://localhost:3000
let baseUrl = '/api'
    // let baseUrl = 'http://localhost:4000'
    // 1 
export const reqAddress = (geohash) => ajax(baseUrl + '/position/' + geohash)

// 2 获取我们的分类 
export const reqCategory = () => ajax(baseUrl + '/index_category')

export const reqShops = ({ latitude, longitude }) => ajax(baseUrl + '/shops', { latitude, longitude })

// 发送短信验证码
export const reqSendCode = (phone) => ajax(baseUrl + '/sendcode', { phone })

// 用户名密码登录
export const reqPwdLogin = ({ name, pwd, captcha }) => ajax(baseUrl + 'login_pwd', { name, pwd, captcha }, 'post')

// 手机号验证码登录
export const reqSmsLogin = (phone, code) => ajax(baseUrl + 'login_sms', { phone, code }, 'post')

// 根据会话获取用户信息
export const reqUserInfo = () => ajax(baseUrl + 'userinfo')

// 用户登出
export const reqLogout = () => ajax(baseUrl + '/logout')

// 获取ShopGoods数据
export const reqShopGoods = () => ajax('/goods')

// 获取ShopRatings数据
export const reqShopRatings = () => ajax('/ratings')

// 获取ShopInfo数据
export const reqShopInfo = () => ajax('/info')
    //AUTH TOKEN：(账户授权令牌) 4e6f20d89eb14e50b15bd8bded5d8724

// ACCOUNT SID：
// 8a216da87206f2ec01720bbfbe8f02e6
// (主账户ID)

// Rest URL(生产)：https://app.cloopen.com:8883

// AppID(默认)：8a216da87206f2ec01720bbfbef202ec未上线